package week12;
import java.sql.*;

/**
 * JdbcInsert1.java - Demonstrates how to INSERT data into an postgresql
 *                    database using Java JDBC.
 */
class JdbcInsert1 {

    public static void main (String[] args) {
        try {
            String dburl = "jdbc:postgresql://192.168.61.205:5432/license";
            Connection conn = DriverManager.getConnection(dburl,"postgres","");
            Statement st = conn.createStatement();
            st.executeUpdate("INSERT INTO users " +
                "VALUES (1001, 'Simpson', 'Mr.', 'Springfield', 2001)");
           // st.executeUpdate("INSERT INTO Customers " +
             //   "VALUES (1002, 'McBeal', 'Ms.', 'Boston', 2004)");
           // st.executeUpdate("INSERT INTO Customers " +
            //    "VALUES (1003, 'Flinstone', 'Mr.', 'Bedrock', 2003)");
           // st.executeUpdate("INSERT INTO Customers " +
            //    "VALUES (1004, 'Cramden', 'Mr.', 'New York', 2001)");

            conn.close();
        } catch (Exception e) {
            System.err.println("Got an exception! ");
            System.err.println(e.getMessage());
        } 

    }
}
